package com.leaves.common.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: LEAVES
 * @Version 1.0
 * @Date: 2022年08月01日  11时24分39秒
 * @Description:
 */
public class PrintRequest {

    private static final Logger LOGGER = LoggerFactory.getLogger(PrintRequest.class);

    public static void requestInfo(HttpServletRequest req) {
        LOGGER.info("path = {}", req.getContextPath());
        LOGGER.info("IP = {}", IpUtil.getIpAddress(req));
        LOGGER.info("URI = {}", req.getRequestURI());
        LOGGER.info("urL = {}", req.getRequestURL());
        LOGGER.info("CUSTOMIZE-CLIENT-TYPE = {}", req.getHeader("CUSTOMIZE-CLIENT-TYPE"));
        LOGGER.info("PathInfo = {}", req.getPathInfo());
        LOGGER.info("QueryString = {}", req.getQueryString());
        LOGGER.info("Method = {}", req.getMethod());
        LOGGER.info("UserPrincipal = {}", req.getUserPrincipal());
        LOGGER.info("AuthType = {}", req.getAuthType());
        LOGGER.info("ServerPort = {}", req.getServerPort());
        LOGGER.info("LocalPort = {}", req.getLocalPort());
        LOGGER.info("RemotePort = {}", req.getRemotePort());
    }
}
